package com.weilx959.spt.core.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Locale;

@Getter
@AllArgsConstructor
public enum LanguageEnum {
    ENGLISH(Locale.ENGLISH, "English"),
    SIMPLIFIED_CHINESE(Locale.SIMPLIFIED_CHINESE, "中文");

    private final Locale locale;
    private final String name;

    public static LanguageEnum valueOf(Locale locale) {
        return LanguageEnum.valueOf(locale.getLanguage().toUpperCase());
    }
}
